; Music of Barry Mc Guigan's Boxing (1985) (Activision)
; Ripped by Megachur the 02/12/2006

	write "BARRYMGB.BIN"

music_date_rip	equ &02c6
music_adr	equ &1000
first_theme	equ 0
last_theme	equ 3

	read "music_header_v1_0.asm"

;
.play_music
;
	ld ix,l1201
	bit 0,(ix+#00)
	jr nz,l1011
	ld c,#3f
	ld a,#07
	jp l11dc
.l1011
	di
	bit 1,(ix+#00)
	jr z,l101b
	call l105b
.l101b
	push iy
	bit 0,(ix+#06)
	jr z,l1030
	dec (ix+#19)
	jr nz,l1030
	sub a
	ld iy,l120e
	call l10ec
.l1030
	bit 1,(ix+#06)
	jr z,l1044
	dec (ix+#1b)
	jr nz,l1044
	ld a,#02
	ld iy,l1210
	call l10ec
.l1044
	bit 2,(ix+#06)
	jr z,l1058
	dec (ix+#1d)
	jr nz,l1058
	ld a,#04
	ld iy,l1212
	call l10ec
.l1058
	pop iy
	ret
.l105b
	ld a,(l1200)
	ld hl,l1238
	and a
	jr z,l106b
	ld b,a
	ld de,#0012
.l1068
	add hl,de
	djnz l1068
.l106b
	ld bc,#0012
	ld de,l1202
	ldir
	ld e,#06
	sub a
.l1076
	ld c,#00
	push af
	call l11dc
	di
	pop af
	inc a
	dec e
	jr nz,l1076
	ld a,#0d
	ld hl,l120d
	ld e,#08
.l1089
	ld c,(hl)
	push af
	call l11dc
	di
	pop af
	dec hl
	dec a
	dec e
	jr nz,l1089
	ld a,(ix+#06)
	cpl
	ld c,a
	rrca
	rrca
	rrca
	or c
	and #07
	ld (ix+#06),a
	ld hl,(l120e)
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l1214),de
	inc hl
	ld (l120e),hl
	ld hl,(l1210)
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l1216),de
	inc hl
	ld (l1210),hl
	ld hl,(l1212)
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l1218),de
	inc hl
	ld (l1212),hl
	ld a,#01
	ld (ix+#19),a
	ld (ix+#1b),a
	ld (ix+#1d),a
	ld b,#03
	ld hl,l1208
	ld de,l1220
.l10e0
	ld a,(hl)
	ld (de),a
	inc hl
	inc de
	inc de
	djnz l10e0
	res 1,(ix+#00)
	ret
.l10ec
	ld (l11fa),a
.l10ef
	ld l,(iy+#06)
	ld h,(iy+#07)
	ld a,(hl)
	inc hl
	ld (iy+#06),l
	ld (iy+#07),h
	ld c,a
	cp #ff
	jr nz,l1134
.l1102
	ld l,(iy+#00)
	ld h,(iy+#01)
	ld e,(hl)
	inc hl
	ld d,(hl)
	inc hl
	ld (iy+#00),l
	ld (iy+#01),h
	ld a,d
	or e
	jr nz,l111c
	ld a,(l11fa)
	jp l11d0
.l111c
	ld a,d
	cp #ff
	jr nz,l112c
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (iy+#00),e
	ld (iy+#01),d
	jr l1102
.l112c
	ld (iy+#06),e
	ld (iy+#07),d
	jr l10ef
.l1134
	and #0f
	cp #0c
	jr c,l1174
	jr nz,l1141
	ld de,#0071
	jr l1182
.l1141
	cp #0d
	jr nz,l1157
	ld de,#0000
	ld a,(l11fa)
	call l11c4
	set 7,(iy+#0f)
	ld (iy+#0c),#01
	ret
.l1157
	cp #0e
	jr nz,l1173
	push bc
	ld c,#00
	ld a,(l11fa)
	srl a
	add #08
	call l11dc
	set 6,(iy+#0f)
	pop bc
	ld de,#0000
	ld l,c
	jr l11a8
.l1173
	ret
.l1174
	ld hl,l1280
	ld a,c
	and #3f
	add a
	ld e,a
	ld d,#00
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
.l1182
	ld l,c
	ld a,(l11fa)
	call l11c4
	ld c,(ix+#0c)
	ld a,#0d
	call l11dc
	bit 6,(iy+#0f)
	jr z,l11a8
	res 6,(iy+#0f)
	ld c,(iy+#12)
	ld a,(l11fa)
	srl a
	add #08
	call l11dc
.l11a8
	ld a,l
	rlca
	rlca
	and #03
	ld hl,l1202
	ld c,a
	ld b,#00
	add hl,bc
	ld a,(hl)
	bit 7,(iy+#0f)
	jr z,l11c0
	dec a
	res 7,(iy+#0f)
.l11c0
	ld (iy+#0c),a
	ret
.l11c4
	ld c,e
	push af
	call l11dc
	pop af
	inc a
	ld c,d
	call l11dc
	ret
.l11d0
	ld c,#3f
	ld a,#07
	call l11dc
	res 0,(ix+#00)
	ret
.l11dc
	ld b,#f4
	out (c),a
	ld b,#f6
	in a,(c)
	or #c0
	out (c),a
	and #3f
	out (c),a
	ld b,#f4
	out (c),c
	ld b,#f6
	ld c,a
	or #80
	out (c),a
	out (c),c
	ret
.l1200 equ $ + 6
.l11fa
	db #00,#00,#00,#00,#00,#00,#00
.l1208 equ $ + 7
.l1202 equ $ + 1
.l1201
	db #00,#00,#00,#00,#00,#00,#00,#00
.l1210 equ $ + 7
.l120e equ $ + 5
.l120d equ $ + 4
	db #00,#00,#00,#00,#00,#00,#00,#00
.l1218 equ $ + 7
.l1216 equ $ + 5
.l1214 equ $ + 3
.l1212 equ $ + 1
	db #00,#00,#00,#00,#00,#00,#00,#00
.l1220 equ $ + 7
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00
.l1238
	db #03,#06,#0c,#18,#1f,#18,#0d,#0f
	db #10,#7f,#00,#09,#00,#13,#14,#13
	db #30,#13,#02,#04,#08,#10,#1f,#18
	db #0d,#0f,#10,#ff,#00,#09,#6c,#13
	db #8a,#13,#96,#13,#04,#06,#0c,#18
	db #1f,#38,#0d,#0d,#10,#ff,#1f,#09
	db #b6,#13,#ba,#13,#be,#13,#02,#04
	db #08,#10,#1f,#38,#0e,#0f,#0c,#ff
	db #1f,#09,#c2,#13,#cc,#13,#d6,#13
.l1280
	db #77,#07,#0c,#07,#a7,#06,#47,#06
	db #ed,#05,#98,#05,#47,#05,#fc,#04
	db #d4,#04,#70,#04,#31,#04,#f4,#03
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #dc,#03,#86,#03,#53,#03,#24,#03
	db #f6,#02,#cc,#02,#a4,#02,#7e,#02
	db #5a,#02,#38,#02,#18,#02,#fa,#01
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #de,#01,#c3,#01,#aa,#01,#92,#01
	db #7b,#01,#66,#01,#52,#01,#3f,#01
	db #2d,#01,#1c,#01,#0c,#01,#fd,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #ef,#00,#e1,#00,#d5,#00,#c9,#00
	db #be,#00,#b3,#00,#a9,#00,#9f,#00
	db #96,#00,#8e,#00,#86,#00,#7f,#00
	db #00,#00,#00,#00,#00,#00,#00,#00
	dw l1400,l140b,l140b,l1422
	dw l1400,l1455,l1455,l1422
	dw l1446,#0000,l1472,l147d
	dw l147d,l14be,l14cb,l14be
	dw l1472,l147d,l147d,l14be
	dw l14cb,l14be,l14d7,#0000
	dw l14e6,l14f7,l14f7,l14f7
	dw l14f7,l14f7,l14f7,l14f7
	dw l14f7,l1514,l151e,l151e
	dw l14e6,l14f7,l14f7,l14f7
	dw l14f7,l14f7,l14f7,l14f7
	dw l14f7,l1514,l151e,l151e
	dw l14e6,l1527
	db #00,#00,#00,#00,#00,#00,#00,#00
	dw l152c,l1534,l1545,l154b
.l1378 equ $ + 4
	dw l1534,l1545,l1553,l154b
	dw l1534,l1545,l154b,l1534
.l138a equ $ + 6
	dw l1545,#ffff,l1378,l157d
	dw l1595,l157d,l159c,#ffff
.l1396 equ $ + 2
	dw l138a,l15cc,l15cc,l15cc
	dw l15cc,l15cc,l15cc,l15cc
	dw l15cc,l15cc,l15cc,l15cc
	dw l15cc,l15cc,l15d5,#ffff
	dw l1396,l15de,#0000,l1615
	dw #0000,l164c,#0000,l1683
	dw l16d6,l1683,l16de,#0000
	dw l16ea,l1737,l16ea,l173f
	dw #0000,l174b,l17ae,l174b
	dw l17b9,#0000
	db #75,#b2,#72,#f0,#63,#5b,#97,#8e
	db #65,#62,#99,#8e,#a7,#b2,#ff,#f2
	db #f2,#f2,#75,#b2,#72,#f7,#f7,#f7
	db #75,#b2,#72,#f0,#f0,#f0,#72,#aa
.l1400
	db #63,#5b,#97,#8e,#65,#62,#99,#8e
.l140b equ $ + 3
	db #a7,#b2,#ff,#f2,#f2,#f2,#75,#b2
	db #72,#f7,#f7,#f7,#75,#b2,#72,#f0
	db #f0,#f0,#72,#aa,#6a,#e7,#e7,#e7
.l1422 equ $ + 2
	db #ce,#ff,#8e,#57,#cd,#57,#9a,#57
	db #4e,#60,#9a,#5a,#a0,#a2,#8e,#57
	db #cd,#57,#9a,#57,#4e,#60,#97,#57
	db #d5,#8e,#57,#cd,#57,#9a,#57,#4e
.l1446 equ $ + 6
	db #60,#9a,#5a,#a0,#a2,#ff,#63,#5a
	db #97,#8e,#65,#62,#99,#8e,#a5,#a7
.l1455 equ $ + 5
	db #e7,#e7,#e7,#e7,#ff,#f2,#f2,#b2
	db #67,#6a,#75,#b2,#72,#f7,#f7,#b7
	db #67,#6a,#75,#b2,#72,#f0,#f0,#b0
	db #6a,#70,#72,#aa,#6a,#e7,#e7,#e7
.l1472 equ $ + 2
	db #ce,#ff,#44,#4a,#93,#8e,#45,#50
.l147d equ $ + 5
	db #95,#8e,#95,#97,#ff,#47,#4e,#47
	db #4e,#47,#4e,#47,#4e,#47,#4e,#47
	db #4e,#4a,#4e,#47,#4e,#50,#4e,#50
	db #4e,#50,#4e,#50,#4e,#50,#4e,#50
	db #4e,#4a,#4e,#47,#4e,#45,#4e,#45
	db #4e,#45,#4e,#45,#4e,#45,#4e,#45
	db #4e,#42,#4e,#45,#4e,#47,#4e,#47
	db #4e,#47,#4e,#47,#4e,#47,#4e,#40
.l14be equ $ + 6
	db #4e,#42,#4e,#45,#4e,#ff,#8e,#47
	db #cd,#47,#8a,#47,#4e,#50,#8a,#4a
.l14cb equ $ + 3
	db #90,#92,#ff,#8e,#47,#cd,#47,#8a
.l14d7 equ $ + 7
	db #47,#4e,#50,#87,#47,#c5,#ff,#44
	db #4a,#94,#8e,#45,#50,#95,#8e,#85
.l14e6 equ $ + 6
	db #87,#c7,#c7,#c7,#c7,#ff,#65,#cd
	db #65,#cd,#a5,#b0,#65,#cd,#65,#cd
.l14f7 equ $ + 7
	db #a5,#b0,#a5,#cd,#a5,#cd,#ff,#65
	db #cd,#65,#cd,#65,#cd,#65,#70,#65
	db #cd,#65,#cd,#65,#cd,#65,#cd,#65
	db #cd,#65,#cd,#65,#70,#65,#cd,#65
.l1514 equ $ + 4
	db #cd,#65,#cd,#ff,#b0,#8e,#a5,#8e
.l151e equ $ + 6
	db #a5,#8e,#a5,#b0,#cd,#ff,#b0,#8e
.l1527 equ $ + 7
	db #a5,#8e,#a5,#8e,#a5,#8e,#ff,#e5
.l152c equ $ + 4
	db #e5,#ce,#ce,#ff,#a8,#ce,#a9,#b4
.l1534 equ $ + 4
	db #b9,#8e,#b7,#ff,#8e,#b6,#8e,#b2
	db #8e,#b4,#b6,#b4,#8e,#b1,#a9,#8e
.l1545 equ $ + 5
	db #a9,#8e,#a4,#8e,#ff,#a7,#ce,#a7
.l154b equ $ + 3
	db #ce,#ce,#ff,#ce,#8e,#a9,#b4,#b9
.l1553 equ $ + 3
	db #8e,#b7,#ff,#8e,#ce,#ab,#b6,#bb
	db #8e,#b9,#8e,#b8,#8e,#b4,#8e,#b6
	db #b8,#b6,#8e,#b2,#ab,#8e,#ab,#8e
	db #a6,#8e,#a9,#ce,#a9,#ce,#ce,#b7
	db #b4,#b0,#b7,#ce,#b9,#b6,#b2,#b9
.l157d equ $ + 5
	db #8e,#f9,#b9,#ce,#ff,#99,#a2,#a4
	db #8e,#b1,#8e,#a9,#8e,#ab,#ce,#a7
	db #8e,#a2,#8e,#99,#8e,#a2,#a4,#8e
.l1595 equ $ + 5
	db #b1,#8e,#a9,#8e,#ff,#ab,#ce,#a7
.l159c equ $ + 4
	db #ce,#8e,#99,#ff,#ab,#ce,#a7,#ce
	db #8e,#9b,#9b,#a4,#a6,#8e,#b3,#8e
	db #ab,#8e,#b1,#ce,#a9,#8e,#a4,#8e
	db #9b,#8e,#a4,#a6,#8e,#b3,#8e,#ab
	db #8e,#b1,#ce,#a9,#ce,#ce,#a0,#a4
	db #a8,#b0,#ce,#a2,#a6,#a9,#b2,#8e
.l15cc equ $ + 4
	db #f2,#b2,#ce,#ff,#b5,#b5,#b5,#b5
.l15d5 equ $ + 5
	db #b0,#b5,#b5,#b5,#ff,#b5,#b5,#b5
.l15de equ $ + 6
	db #b5,#b0,#b0,#b0,#b5,#ff,#a9,#24
	db #29,#33,#b7,#b6,#b4,#b2,#b4,#4e
	db #71,#f9,#f9,#ab,#26,#2b,#34,#b9
	db #b8,#b6,#b4,#b6,#4e,#73,#fb,#fb
	db #b1,#28,#31,#36,#bb,#ba,#b8,#b6
	db #b8,#4e,#75,#cc,#cc,#2b,#31,#32
	db #34,#36,#38,#b9,#31,#32,#34,#36
.l1615 equ $ + 5
	db #38,#39,#bb,#ce,#ff,#99,#14,#19
	db #23,#a7,#a6,#a4,#a2,#a4,#4e,#61
	db #e9,#e9,#9b,#16,#1b,#24,#a9,#a8
	db #a6,#a4,#a6,#4e,#63,#eb,#eb,#a1
	db #18,#21,#26,#ab,#aa,#a8,#a6,#a8
	db #4e,#65,#f1,#f1,#24,#26,#28,#29
	db #2b,#31,#b2,#26,#28,#29,#2b,#31
.l164c equ $ + 4
	db #32,#b4,#ce,#ff,#99,#0e,#0e,#0e
	db #ce,#ce,#99,#94,#99,#94,#51,#52
	db #94,#9b,#0e,#0e,#0e,#ce,#ce,#9b
	db #96,#9b,#96,#53,#54,#96,#a1,#0e
	db #0e,#0e,#ce,#ce,#a1,#98,#a1,#98
	db #55,#56,#98,#18,#19,#1b,#21,#22
	db #24,#a6,#19,#1b,#21,#22,#24,#26
.l1683 equ $ + 3
	db #28,#e4,#ff,#ea,#aa,#b5,#8e,#ba
	db #f8,#b8,#b7,#b5,#b3,#f5,#b5,#b2
	db #aa,#a5,#e8,#a8,#e9,#a9,#ea,#aa
	db #b5,#8e,#bb,#b8,#b7,#b4,#f5,#b5
	db #f5,#f5,#f5,#ce,#ce,#ce,#f0,#b0
	db #b7,#8e,#bc,#fa,#ba,#b9,#b7,#b5
	db #f7,#b7,#b4,#b0,#a7,#ea,#aa,#eb
	db #ab,#f0,#b0,#b7,#8e,#bc,#ba,#b9
	db #b5,#f7,#b7,#f7,#f7,#f7,#ce,#ce
	db #ce,#a9,#b1,#b5,#b8,#b5,#b2,#aa
.l16d6 equ $ + 6
	db #b3,#b7,#ba,#b7,#b4,#ff,#f9,#f9
.l16de equ $ + 6
	db #f9,#f9,#ce,#f9,#b9,#ff,#b8,#ce
	db #b9,#cd,#b9,#cd,#b9,#b8,#ce,#ce
.l16ea equ $ + 2
	db #8e,#ff,#9b,#ce,#ce,#8e,#ce,#8e
	db #f0,#b0,#f2,#b2,#aa,#a5,#a2,#a0
	db #9a,#98,#d9,#99,#da,#9a,#a5,#ce
	db #f0,#b0,#f2,#f2,#f2,#f2,#b2,#ce
	db #ce,#ce,#a0,#ce,#ce,#8e,#ce,#8e
	db #f2,#b2,#f4,#b4,#b0,#a7,#a4,#a2
	db #a0,#9a,#db,#9b,#e0,#a0,#a7,#ce
	db #f2,#b2,#f4,#f4,#f4,#f4,#b4,#ce
	db #ce,#ce,#a5,#a9,#b2,#b5,#b2,#a9
.l1737 equ $ + 7
	db #a7,#ab,#b4,#b7,#b4,#ab,#ff,#f5
.l173f equ $ + 7
	db #f5,#f5,#f5,#ce,#f5,#b5,#ff,#b3
	db #ce,#b4,#cd,#b4,#cd,#b4,#b3,#ce
.l174b equ $ + 3
	db #ce,#8e,#ff,#8a,#ce,#ce,#8e,#ce
	db #8e,#93,#95,#97,#da,#9a,#d5,#95
	db #93,#92,#90,#c5,#85,#ca,#8a,#92
	db #8e,#8a,#d3,#93,#d5,#95,#8a,#cd
	db #8a,#85,#8a,#cd,#8a,#85,#8a,#cd
	db #8a,#85,#8a,#cd,#8a,#85,#90,#ce
	db #ce,#8e,#ce,#8e,#95,#97,#99,#e0
	db #a0,#d7,#97,#95,#94,#92,#c7,#87
	db #d0,#90,#94,#8e,#90,#d5,#95,#d7
	db #97,#90,#cd,#90,#87,#90,#cd,#90
	db #87,#90,#cd,#90,#87,#90,#cd,#90
	db #87,#91,#95,#98,#a2,#99,#95,#93
.l17ae equ $ + 6
	db #97,#9a,#a3,#9b,#97,#ff,#95,#d5
	db #d0,#90,#85,#ce,#8e,#85,#87,#89
.l17b9 equ $ + 1
	db #ff,#ce,#ce,#ce,#ce,#ce,#ce,#ff
	db #00,#00

;
.init_music		; added by Megachur
;
	ld (l1200),a
	ld a,&ff
	ld (l1201),a
	ret		; added by Megachur
; 1200 = theme number 0,1,2,3
; 1201 = 00 stop FF Set theme

;org #2e1f
;ld iy,#197f
;call #1000

.game_name
	db "Barry Mc Guigan's Boxing",0
.game_year
	db "1985",0
.game_publisher
	db "Activision",0
.music_author
	db "",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
